<template>
  <div class="enterprise-person">
    <el-table :data="personList"
              row-key="id"
              border
              height="250"
              style="width: 100%">
      <el-table-column prop="name" label="姓名" width="100"></el-table-column>
      <el-table-column prop="idCard" label="居住证号" width="180"></el-table-column>
      <el-table-column prop="nation" label="民族" width="110"></el-table-column>
      <el-table-column prop="linkPhone" label="个人联系电话" width="110"></el-table-column>
      <el-table-column prop="residenceAddress" label="户籍地址">
        <template slot-scope="{row}">
          <el-tooltip effect="dark" :content="row.residenceAddress" placement="top">
            <span class="line-clamp-1">{{ row.residenceAddress }}</span>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="censusRegisterAddress" label="暂住地址">
        <template slot-scope="{row}">
          <el-tooltip effect="dark" :content="row.censusRegisterAddress" placement="top">
            <span class="line-clamp-1">{{ row.censusRegisterAddress }}</span>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="masterName" label="户主姓名" width="100"></el-table-column>
      <el-table-column prop="masterLinkPhone" label="户主联系电话" width="110"></el-table-column>
      <el-table-column prop="personTypeName" label="人员类型" width="110"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import util from '@/libs/util'
export default {
  name: "EnterprisePerson",
  props: {
    list: {
      type: Array,
      default: () => []
    },
    personTypeList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      personList: []
    }
  },
  watch: {
    list: {
      deep: true,
      handler(arr) {
        this.personList = arr.map(e => {
          return {
            ...e,
            personTypeName: util.showDicValue(e.personTypeId, this.personTypeList) || '-'
          }
        })
      }
    }
  }
}
</script>

<style scoped>

</style>
